package com.algs4.chp1;

import java.util.Iterator;
import java.util.ListIterator;
import edu.princeton.cs.algs4.StdIn;
import edu.princeton.cs.algs4.StdOut;

/**
 * 链表方式实现Stack
 * @param <Item>
 * @author shishuo
 */
public class Stack<Item> implements Iterable<Item> {
    private Node first;

    /**
     * 定义 链表节点
     */
    private class Node {
        Item item;
        Node next;
    }



    @Override
    public Iterator<Item> iterator() {
        return new ListIterator<Item>() {
            @Override
            public boolean hasNext() {
                return false;
            }

            @Override
            public Item next() {
                return null;
            }

            @Override
            public boolean hasPrevious() {
                return false;
            }

            @Override
            public Item previous() {
                return null;
            }

            @Override
            public int nextIndex() {
                return 0;
            }

            @Override
            public int previousIndex() {
                return 0;
            }

            @Override
            public void remove() {

            }

            @Override
            public void set(Item item) {

            }

            @Override
            public void add(Item item) {

            }
        };
    }
}
